QuickTime 3 Reference

| Previous | Chapter Contents | Chapter Top | Next |

Setting up an Effect Description

The first step is to provide an effect description. The code shown in Listing 12 is very similar to the code described in "Creating an Effect Description" .

Listing 12 Providing an effect description

{
    QTAtomContainer     myEffectDesc = NULL;
    OSType              myType;
    OSErr               myErr = noErr;
    long                myLong;

    // Create a new, empty effect description
    myErr = QTNewAtomContainer(&myEffectDesc);

    // This example is an effect description for a SMPTE effect
    myType = OSTypeConst('smpt');
    myErr = QTInsertChild(myEffectDesc,
                    kParentAtomIsContainer,
                    kParameterWhatName,
                    kParameterWhatID,
                    0,
                    sizeof(myType),
                    &myType,
                    NULL);

    // Now reference the two sources to be used. These will not be items
    // in an input map. Instead the source names used will be resolved in
    // the decompression sequence.
    myType = OSTypeConst('srcA');
    myErr = QTInsertChild(myEffectDesc,
                    kParentAtomIsContainer,
                    kEffectSourceName,
                    1,
                    0,
                    sizeof(myType),
                    &myType,
                    NULL);

    // Add the second source
    myType = OSTypeConst('srcB');
    myErr = QTInsertChild(myEffectDesc,
                    kParentAtomIsContainer,
                    kEffectSourceName,
                    2,
                    0,
                    sizeof(myType),
                    &myType,
                    NULL);

    // This example uses SMTPE effect number 74, so add a WipeID
    // parameter with the value 74
    myLong = 74;
    myErr = QTInsertChild(myEffectDesc,
                    kParentAtomIsContainer,
                    OSTypeConst('wpID'),
                    1,
                    0,
                    sizeof(myLong),
                    &myLong,
                    NULL);
}

© 1998 Apple Computer, Inc.

| Previous | Chapter Contents | Chapter Top | Next |